<template>
	<view v-if="show">
		<view v-for="(value,key) in StudentStatusInfo" :key="key" @click="gotoInfo(key)">
			<statusItem :ColorType="ColorType" :StudentFindPass="value"></statusItem>
		</view>
	</view>
</template>

<script>
	import statusItem from './statusItemChild/statusItem.vue'
	import {
		// getTest,
		getStudentFindPass
	} from '@/api/status/service.js';
	
	import {
		getStudentStatusInfoByStatusAndTid
	} from '@/api/status/service.js';
	
	
	export default {
		props: {
			show: {
				type: Boolean,
				default: false
			},
			xmId :{
				type:Number,
				default:0
			}
			
		},
		data(){
			return{
				ColorType:1,
				// StudentFindPass:'',
				// id :'1',
				StudentStatusInfo:[],
				tId:0
			}
		},
		components:{
			statusItem,
		},
		created() {
			console.log("created");
			this.tId = uni.getStorageSync("Teaid");
			this.loadData();
			
		},
		
		methods:{
			gotoInfo(res){
				console.log(res)
			},
			/* getData(id){
				getStudentFindPass(id)
				.then(res=>{
					this.StudentFindPass = res.data;
					console.log(res.data)
				}).catch(res=>{
					console.log(res)
				})
			},
			 */
			loadData() {
				console.log("aaaa",this.tId);
				getStudentStatusInfoByStatusAndTid(this.tId, 1)
					.then(res => {
						this.StudentStatusInfo = res.data.list
						console.log(this.StudentStatusInfo)
						console.log(res)
					}).catch(res => {
						console.log(res)
					})
			}
		}
	}
</script>

<style>
	
</style>
